<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>window对象</title>
		<script>
		  function showWin(){
			  window.alert(window.outerHeight+"*"+window.outerWidth);
			  window.alert("内部大小："+window.innerHeight+"*"+window.innerWidth);
			  //window.alert("左顶点位置:"+window.pageXOffset+","+window.pageYOffset)
			  window.alert("左顶点位置:"+window.screenX+","+window.screenY);
		  }
		  function jump(){
			  window.location="http://www.bdqn.cn";
		  }
		  function openNew(){
			  // window.open("https://www.oschina.net");
			 window.open("https://www.oschina.net","oschina",'width=200,height=100,location=0');
		  }
		  function closeWin(){
			  if(window.confirm("真的要取消？"))
				 window.close();
		  }
		  function returnP(){
			  window.history.back();
		  }
		  function showLocat(){
			  console.log("host:"+window.location.host);
			  console.log("hostname:"+window.location.hostname);
			  console.log("href:"+window.location.href);
			  console.log("pathname:"+window.location.pathname);
		  }
		  function locationGo1(){
			  window.location.href="http://www.itpub.net";
		  }
		  function locationGo2(){
		  			  window.location.replace("https://www.oschina.net");
		  }
		  function gotoBdqn(){
			  window.location.replace("https://www.bdqn.cn");
		  }
		</script>
	</head>
	<body>
		<button type="button" onclick="showWin()">点击显示</button>
		
		<button type="button" onclick="jump()">走</button>
		
		<button type="button" onclick="openNew()">打开新窗口</button>
		
		<button type="button" onclick="closeWin()">关闭本窗口</button>
		
		<button type="button" onclick="returnP()">返回上一个网页</button>
		
		<button type="button" onclick="showLocat()">获得地址相关的信息</button>
		<button type="button" onclick="	window.location.reload	()">刷新</button>
		<button type="button" onclick="locationGo1()">跳走</button>
		<button type="button" onclick="locationGo2()">跳走2</button>
		<a href="javascript:void(0)" onclick="gotoBdqn()">跳到bdqn总发布</a>
		<button type="button" onclick="window.print()">打印窗口</button>
	</body>
</html>
